Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Dunn-Šidák #179

Open
wants to merge 4 commits into
base: developer
Choose a base branch
from
Open

FR: Dunn-Šidák #179

wants to merge 4 commits into from

Conversation

omaus
Copy link
Contributor

@omaus omaus commented Jan 28, 2022

Please reference the issue(s) this PR is related to

Closes #178

Please list the changes introduced in this PR

  • Dunn-Šidák correction added

Description

Dunn-Šidák correction can now be found under MultipleTesting module. Unit tests are implemented as well.

  • The project builds without problems on your machine
  • Added unit tests regarding the added features

@@ -63,6 +63,16 @@ module MultipleTesting =
|> Seq.ofList


// adapted from: https://en.wikipedia.org/wiki/%C5%A0id%C3%A1k_correction & https://personal.utdallas.edu/~herve/Abdi-Bonferroni2007-pretty.pdf
// Old: /// Computes the Dunn-Šidák correction onto a collection of p-values with a given alpha. Returns a list of booleans which state if the p-value should be rejected or not, and the new critical value for this alpha.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove old comment

@@ -63,6 +63,16 @@ module MultipleTesting =
|> Seq.ofList


// adapted from: https://en.wikipedia.org/wiki/%C5%A0id%C3%A1k_correction & https://personal.utdallas.edu/~herve/Abdi-Bonferroni2007-pretty.pdf
// Old: /// Computes the Dunn-Šidák correction onto a collection of p-values with a given alpha. Returns a list of booleans which state if the p-value should be rejected or not, and the new critical value for this alpha.
/// Computes the Dunn-Šidák correction onto a collection of p-values with a given alpha. Returns a critical value. p-values above the critical value should be rejected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to not use special characters in fs or fsx files. Describe what this method correct for? (FWER?)

let dunnSidak alpha (pValues : seq<float>) =
let m = float (Seq.length pValues)
let criticalValue = 1. - (1. - alpha) ** (1. / m)
// List.map (fun p -> if p > criticalValue then true, p else false, p) (List.ofSeq pValues),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remove this line
  • What is the default procedure if pvalues in the input sequence are nan? Are they excluded from determining m? Should there be a special case? I don't know, but i can think of reasons why to exclude nan tests and maybe it is commonly performed.

Copy link
Contributor Author

@omaus omaus Jan 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find any case like this for this test. So I suggest to just exclude them. Same goes for values > 1 and < 0.

@@ -348,6 +348,23 @@ let benjaminiHochbergTests =
]


[<Tests>]
let dunnSidakTest =
// taken from: https://www.real-statistics.com/hypothesis-testing/familywise-error/bonferroni-and-dunn-sidak-tests/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link is broken. Please provide references to papers, R, SPSS packages or similar sources

@omaus omaus requested a review from bvenn February 1, 2022 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Dunn-Šidák correction
2 participants